home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2005 October
/
PCWOCT05.iso
/
Software
/
FromTheMag
/
XAMPP 1.4.14
/
xampp-win32-1.4.14-installer.exe
/
xampp
/
php
/
pear
/
docs
/
tidy
/
examples
/
.tmpcleanhtml.php
next >
Wrap
PHP Script
|
2004-03-24
|
778b
|
38 lines
<?php
/*
* cleanhtml.php
*
* A simple script to clean and repair HTML,XHTML,PHP,ASP,etc. documents
* if no file is provided, it reads from standard input.
*
* By: John Coggeshall <john@php.net>
*
* Usage: php cleanhtml.php [filename]
*
*/
if(!isset($_SERVER['argv'][1])) {
$data = file_get_contents("php://stdin");
tidy_parse_string($data);
} else {
tidy_parse_file($_SERVER['argv'][1]);
}
tidy_clean_repair();
if(tidy_warning_count() ||
tidy_error_count()) {
echo "\n\nThe following errors or warnings occured:\n";
echo tidy_get_error_buffer();
echo "\n";
}
echo tidy_get_output();
?>